#ifndef CONNECTIONTHREAD_H
#define CONNECTIONTHREAD_H

#include <QThread>
#include "ntcpsocket.h"
#include "connection.h"
#include "globalconnectionmanager.h"

class ConnectionThread : public QThread
{
    Q_OBJECT
public:
    explicit ConnectionThread(int sockDescriptor, QObject *parent = 0);
    ~ConnectionThread();

protected:
    int sockDescriptor;
    void run();
    void removeConnection(Connection *pConnection);

private slots:
    void newConnection(Connection *pConnection);
    void errorConnection(Connection *pConnection);
    void disconnected();
    void destroyed(QObject *pObj = 0);
    void connectionReady(Connection *pConnection);

};

#endif // CONNECTIONTHREAD_H
